var login = {
	init: function() {
		login.loginForm = $('#loginForm');
	},
	doLogin: function () {
		$.messager.progress({
			text : '正在处理...'
		});
		login.loginForm.form('submit', {
			url: window.hiring.ctx + '/TestServlet?command=login',
			onSubmit: function(){
				var isValid = $(this).form('validate');
				if (!isValid){
					$.messager.progress('close');	
				}
				return isValid;
			},
			success: function(data){
				$.messager.progress('close');
				console.info(data);
				if (data) {
					location = window.hiring.ctx + '/easyui/demo/main.jsp';
				}
			}
		});	
	}
};

$(function(){
	login.init();
});